parisc: Delay write-protection until mark_rodata_ro() call
authorHelge Deller <deller@gmx.de>
Sat, 31 Aug 2024 12:02:06 +0000 (14:02 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 8 Sep 2024 18:29:08 +0000 (20:29 +0200)
commiteef1b9596ee2aa77bae04bc0f253ced6697a31fc
tree0bbc7192b282a07f532056940cb1ea91d0aa1d88
parent3585802d3f62a5528b826c5f4a9b81e82438dae6
parisc: Delay write-protection until mark_rodata_ro() call

Origin: https://git.kernel.org/linus/213aa670153ed675a007c1f35c5db544b0fefc94

Do not write-protect the kernel read-only and __ro_after_init sections
earlier than before mark_rodata_ro() is called.  This fixes a boot issue on
parisc which is triggered by commit 91a1d97ef482 ("jump_label,module: Don't
alloc static_key_mod for __ro_after_init keys"). That commit may modify
static key contents in the __ro_after_init section at bootup, so this
section needs to be writable at least until mark_rodata_ro() is called.

Signed-off-by: Helge Deller <deller@gmx.de>
Reported-by: matoro <matoro_mailinglist_kernel@matoro.tk>
Reported-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
Tested-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
Link: https://lore.kernel.org/linux-parisc/096cad5aada514255cd7b0b9dbafc768@matoro.tk/#r
Fixes: 91a1d97ef482 ("jump_label,module: Don't alloc static_key_mod for __ro_after_init keys")
Cc: stable@vger.kernel.org # v6.10+
Gbp-Pq: Topic bugfix/hppa
Gbp-Pq: Name parisc-Delay-write-protection-until-mark_rodata_ro-c.patch
arch/parisc/mm/init.c